package com.heima.leetcode.practice;

/**
 * @author 勾新杰
 * @version 1.0
 * @description: leetcode 190. 颠倒二进制位
 * @date 2025/3/25 20:21
 */
public class E190 {

    public int reverseBits(int n) {
        int result = 0;
        for (int i = 0; i < 32; i++) {
            int bit = n & 1;
            result = result << 1 | bit;
            n >>= 1;
        }
        return result;
    }
}
